<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: Vertex.js</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: Vertex.js</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>// by this, internal face is ccw
// hedgelist is cw
function sortByAngle(a, b) {
    return b.angle - a.angle;
}

var counter = 0;

/**
 * Vertex.
 * Don't instantiate this class in your code.
 * it can only be called by the {@link DCEL} class.
 * @class
 * @private
 * @param {number} x
 * @param {number} y 
 */
function Vertex(x, y) {

    this.id = counter++;

    /**
     * @type number 
     */
    this.x = x;

    /**
     * @type number 
     */
    this.y = y;

    this.hedgelist = [];
    
}

Object.assign(Vertex.prototype, {

    sortincident: function() {
        this.hedgelist.sort(sortByAngle);
    },

    dispose: function() {
        this.hedgelist.length = 0;
    }

});

export {Vertex};</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="DCEL.html">DCEL</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Aug 27 2018 23:15:07 GMT+0800 (CST)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
